//
//  ACMineLogCell.m
//  ACLiteAVUISDK
//
//  Created by Ben on 2021/4/14.
//

#import "ACMineLogCell.h"

@implementation ACMineLogCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

//设置文件model
-(void)setFileModel:(ACFileModel *)model{
    [self.logImg sd_setImageWithURL:[NSURL URLWithString:model.thumbnail_url] placeholderImage:[UIImage imageWithName:@"live_placeHolder" bundle:ACLiteAVUISDK targetClass:[self class]]];
    if ([model.file_extension isEqual:@"pdf"]) {
        self.typeImg.image = [UIImage imageWithName:@"icon_live_fileType_pdf" bundle:ACLiteAVUISDK targetClass:[self class]];
    }else if([model.file_extension isEqual:@"ppt"] || [model.file_extension isEqual:@"pptx"]){
        self.typeImg.image = [UIImage imageWithName:@"icon_live_fileType_ppt" bundle:ACLiteAVUISDK targetClass:[self class]];
    }else if([model.file_extension isEqual:@"doc"] || [model.file_extension isEqual:@"docx"]){
        self.typeImg.image = [UIImage imageWithName:@"icon_live_fileType_word" bundle:ACLiteAVUISDK targetClass:[self class]];
    }else{
        self.typeImg.image = [UIImage imageWithName:@"icon_live_fileType_img" bundle:ACLiteAVUISDK targetClass:[self class]];
    }
    self.nameLabel.text = model.title;
    self.liveTimeLabel.hidden = YES;
    self.uploadTimeLabel.text = [NSString stringWithFormat:@"上传时间:%@",model.created_at];
}

@end
